<?php /*a:3:{s:79:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\promotionxianshi\xianshi_add.html";i:1591758938;s:64:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\public\header.html";i:1571626691;s:69:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\public\admin_items.html";i:1566788179;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>DSShop单店铺商城系统后台</title>
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <link rel="stylesheet" href="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/css/admin.css">
        <link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.css">
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery-2.1.4.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.validate.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.cookie.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/common.js"></script>
        <script src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/admin.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery.ui.datepicker-zh-CN.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/perfect-scrollbar.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/layer/layer.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>

        <script type="text/javascript">
            var BASESITEROOT = "<?php echo htmlentities(BASE_SITE_ROOT); ?>";
            var ADMINSITEROOT = "<?php echo htmlentities(ADMIN_SITE_ROOT); ?>";
            var BASESITEURL = "<?php echo htmlentities(BASE_SITE_URL); ?>";
            var HOMESITEURL = "<?php echo htmlentities(HOME_SITE_URL); ?>";
            var ADMINSITEURL = "<?php echo htmlentities(ADMIN_SITE_URL); ?>";
        </script>
    </head>
    <body>
        <div id="append_parent"></div>
        <div id="ajaxwaitid"></div>







<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>限时折扣</h3>
                <h5></h5>
            </div>
            <?php if($admin_item): ?>
<ul class="tab-base ds-row">
    <?php if(is_array($admin_item) || $admin_item instanceof \think\Collection || $admin_item instanceof \think\Paginator): if( count($admin_item)==0 ) : echo "" ;else: foreach($admin_item as $key=>$item): ?>
    <li><a href="<?php echo htmlentities($item['url']); ?>" <?php if($item['name'] == $curitem): ?>class="current"<?php endif; ?>><span><?php echo htmlentities($item['text']); ?></span></a></li>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</ul>
<?php endif; ?>
        </div>
    </div>
    
    
    <div class="dssc-form-default">
    <?php if(empty($xianshi_info) || (($xianshi_info instanceof \think\Collection || $xianshi_info instanceof \think\Paginator ) && $xianshi_info->isEmpty())): ?>
    <form id="add_form" action="" method="post">
        <?php else: ?>
        <form id="add_form" action="<?php echo url('Promotionxianshi/xianshi_edit'); ?>" method="post">
            <input type="hidden" name="xianshi_id" value="<?php echo htmlentities($xianshi_info['xianshi_id']); ?>">
            <?php endif; ?>
            <dl>
                <dt><i class="required">*</i><?php echo htmlentities(lang('xianshi_name')); ?><?php echo htmlentities(lang('ds_colon')); ?>
                </dt>
                <dd>
                    <input id="xianshi_name" name="xianshi_name" type="text" maxlength="25" class="text w400"
                           value="<?php if(isset($xianshi_info)): ?><?php echo htmlentities($xianshi_info['xianshi_name']); ?><?php endif; ?>"/>
                    <span></span>
                    <p class="hint"><?php echo htmlentities(lang('xianshi_name_explain')); ?></p>
                </dd>
            </dl>
            <dl>
                <dt><?php echo htmlentities(lang('activity_title')); ?><?php echo htmlentities(lang('ds_colon')); ?></dt>
                <dd>
                    <input id="xianshi_title" name="xianshi_title" type="text" maxlength="10" class="text w200"
                           value="<?php if(isset($xianshi_info)): ?><?php echo htmlentities($xianshi_info['xianshi_title']); ?><?php endif; ?>"/>
                    <span></span>
                    <p class="hint"><?php echo lang('xianshi_title_explain'); ?></p>
                </dd>
            </dl>
            <dl>
                <dt><?php echo htmlentities(lang('activity_description')); ?><?php echo htmlentities(lang('ds_colon')); ?></dt>
                <dd>
                    <input id="xianshi_explain" name="xianshi_explain" type="text" maxlength="30"
                           class="text w400"
                           value="<?php if(isset($xianshi_info)): ?><?php echo htmlentities($xianshi_info['xianshi_explain']); ?><?php endif; ?>"/>
                    <span></span>
                    <p class="hint"><?php echo lang('xianshi_explain_explain'); ?></p>
                </dd>
            </dl>
            <?php if(empty($xianshi_info) || (($xianshi_info instanceof \think\Collection || $xianshi_info instanceof \think\Paginator ) && $xianshi_info->isEmpty())): ?>
            <dl>
                <dt><i class="required">*</i><?php echo htmlentities(lang('start_time')); ?><?php echo htmlentities(lang('ds_colon')); ?>
                </dt>
                <dd>
                    <input id="start_time" name="start_time" type="text" class="text w130"/><em class="add-on"><i class="iconfont">&#xe8d6;</i></em><span></span>
                </dd>
            </dl>
            <dl>
                <dt><i class="required">*</i><?php echo htmlentities(lang('end_time')); ?><?php echo htmlentities(lang('ds_colon')); ?></dt>
                <dd>
                    <input id="end_time" name="end_time" type="text" class="text w130"/><em class="add-on"><i
                            class="iconfont">&#xe8d6;</i></em><span></span>
                </dd>
            </dl>
            <?php endif; ?>
            <dl>
                <dt><i class="required">*</i><?php echo htmlentities(lang('buy_lower_limit')); ?><?php echo htmlentities(lang('ds_colon')); ?></dt>
                <dd>
                    <input id="lower_limit" name="lower_limit" type="text" class="text w130"
                           value="<?php if(empty($xianshi_info) || (($xianshi_info instanceof \think\Collection || $xianshi_info instanceof \think\Paginator ) && $xianshi_info->isEmpty())): ?>1<?php else: ?><?php echo htmlentities($xianshi_info['xianshi_lower_limit']); ?><?php endif; ?>"/><span></span>
                    <p class="hint"><?php echo htmlentities(lang('minimum_purchase_quantity')); ?></p>
                </dd>
            </dl>
            <div class="bottom">
                    <input id="submit_button" type="submit" class="btn" value="<?php echo htmlentities(lang('ds_submit')); ?>">
            </div>
        </form>
</div>
<link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.css">
<script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui-timepicker/jquery-ui-timepicker-addon.min.js"></script>
<script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui-timepicker/i18n/jquery-ui-timepicker-zh-CN.js"></script>
<script>
    $(function () {
        <?php if(empty($xianshi_info) || (($xianshi_info instanceof \think\Collection || $xianshi_info instanceof \think\Paginator ) && $xianshi_info->isEmpty())): ?>
        $('#start_time').datetimepicker({dateFormat: 'yy-mm-dd'});
        $('#end_time').datetimepicker({dateFormat: 'yy-mm-dd'});
        <?php endif; ?>

        jQuery.validator.methods.greaterThanDate = function (value, element, param) {
            var date1 = new Date(Date.parse(param.replace(/-/g, "/")));
            var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
            return date1 < date2;
        };
        jQuery.validator.methods.lessThanDate = function (value, element, param) {
            var date1 = new Date(Date.parse(param.replace(/-/g, "/")));
            var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
            return date1 > date2;
        };
        jQuery.validator.methods.greaterThanStartDate = function (value, element) {
            var start_date = $("#start_time").val();
            var date1 = new Date(Date.parse(start_date.replace(/-/g, "/")));
            var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
            return date1 < date2;
        };
//页面输入内容验证
    $("#add_form").validate({
    errorPlacement: function (error, element) {
    var error_td = element.parent('dd').children('span');
    error_td.append(error);
    },
            onfocusout: false,
            submitHandler: function (form) {
            ds_ajaxpost('add_form');
            },
                    rules: {
                     xianshi_name: {
                    required: true
                    },
                    lower_limit: {
                    required: true,
                            digits:true,
                            min:1
                    }
            },
            messages : {
                    xianshi_name : {
                    required : '<i class="iconfont">&#xe64c;</i><?php echo htmlentities(lang('xianshi_name_error')); ?>'
                    },
                    lower_limit: {
                    required : '<i class="iconfont">&#xe64c;</i><?php echo htmlentities(lang('purchase_limits_cannot_empty')); ?>',
                            digits: '<i class="iconfont">&#xe64c;</i><?php echo htmlentities(lang('minimum_purchase_must_figure')); ?>',
                            min: '<i class="iconfont">&#xe64c;</i><?php echo htmlentities(lang('buy_lower_limit_minimum')); ?>'
                    }
            }
    });
    });
</script>

    
    
    
    
    
</div>
    